package com.cmsky.open.user.model;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import com.cmsky.open.core.base.*;
import com.cmsky.open.core.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import com.cmsky.open.user.model.*;
import com.cmsky.open.user.dao.*;
import com.cmsky.open.user.manager.*;
import com.cmsky.open.user.vo.query.*;

/**
 * @author jandyfish email:jandyfish(a)gmail.com
 * @version 1.0
 * @since 1.0
 */


public class UserMoneyInfo extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "UserMoneyInfo";
	public static final String ALIAS_ID = "编号";
	public static final String ALIAS_USER_ID = "用户编号";
	public static final String ALIAS_MONEY = "充值金额";
	public static final String ALIAS_QD = "渠道类型";
	public static final String ALIAS_QD_USER = "渠道账户";
	public static final String ALIAS_STATE = "充值状态";
	public static final String ALIAS_REGIST_TIME = "创建时间";
	public static final String ALIAS_CONFIG_TIME = "成功时间";
	
	//date formats
	public static final String FORMAT_REGIST_TIME = DATE_FORMAT;
	public static final String FORMAT_CONFIG_TIME = DATE_FORMAT;
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * 编号       db_column: id 
     */	
	
	private java.lang.Integer id;
    /**
     * 用户编号       db_column: user_id 
     */	
	@NotNull 
	private java.lang.Integer userId;
    /**
     * 充值金额       db_column: money 
     */	
	@NotNull 
	private java.lang.Float money;
    /**
     * 渠道类型       db_column: qd 
     */	
	@NotNull @Max(127)
	private Integer qd;
    /**
     * 渠道账户       db_column: qd_user 
     */	
	@NotBlank @Length(max=50)
	private java.lang.String qdUser;
    /**
     * 充值状态       db_column: state 
     */	
	@NotNull @Max(127)
	private Integer state;
    /**
     * 创建时间       db_column: regist_time 
     */	
	@NotNull 
	private java.util.Date registTime;
    /**
     * 成功时间       db_column: config_time 
     */	
	
	private java.util.Date configTime;
	//columns END

	public UserMoneyInfo(){
	}

	public UserMoneyInfo(
		java.lang.Integer id
	){
		this.id = id;
	}

	public void setId(java.lang.Integer value) {
		this.id = value;
	}
	
	public java.lang.Integer getId() {
		return this.id;
	}
	public void setUserId(java.lang.Integer value) {
		this.userId = value;
	}
	
	public java.lang.Integer getUserId() {
		return this.userId;
	}
	public void setMoney(java.lang.Float value) {
		this.money = value;
	}
	
	public java.lang.Float getMoney() {
		return this.money;
	}
	public void setQd(Integer value) {
		this.qd = value;
	}
	
	public Integer getQd() {
		return this.qd;
	}
	public void setQdUser(java.lang.String value) {
		this.qdUser = value;
	}
	
	public java.lang.String getQdUser() {
		return this.qdUser;
	}
	public void setState(Integer value) {
		this.state = value;
	}
	
	public Integer getState() {
		return this.state;
	}
	public String getRegistTimeString() {
		return DateConvertUtils.format(getRegistTime(), FORMAT_REGIST_TIME);
	}
	public void setRegistTimeString(String value) {
		setRegistTime(DateConvertUtils.parse(value, FORMAT_REGIST_TIME,java.util.Date.class));
	}
	
	public void setRegistTime(java.util.Date value) {
		this.registTime = value;
	}
	
	public java.util.Date getRegistTime() {
		return this.registTime;
	}
	public String getConfigTimeString() {
		return DateConvertUtils.format(getConfigTime(), FORMAT_CONFIG_TIME);
	}
	public void setConfigTimeString(String value) {
		setConfigTime(DateConvertUtils.parse(value, FORMAT_CONFIG_TIME,java.util.Date.class));
	}
	
	public void setConfigTime(java.util.Date value) {
		this.configTime = value;
	}
	
	public java.util.Date getConfigTime() {
		return this.configTime;
	}
	
	private UserInfo userInfo;
	
	public void setUserInfo(UserInfo userInfo){
		this.userInfo = userInfo;
	}
	
	public UserInfo getUserInfo() {
		return userInfo;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("UserId",getUserId())
			.append("Money",getMoney())
			.append("Qd",getQd())
			.append("QdUser",getQdUser())
			.append("State",getState())
			.append("RegistTime",getRegistTime())
			.append("ConfigTime",getConfigTime())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof UserMoneyInfo == false) return false;
		if(this == obj) return true;
		UserMoneyInfo other = (UserMoneyInfo)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.append(getUserId(),other.getUserId())
			.append(getMoney(),other.getMoney())
			.append(getQd(),other.getQd())
			.append(getQdUser(),other.getQdUser())
			.append(getState(),other.getState())
			.append(getRegistTime(),other.getRegistTime())
			.append(getConfigTime(),other.getConfigTime())
			.isEquals();
	}
}

